Animations

For animations you first need to have a “trigger” and move the item how you want, look at the example below:

-- here we check if the player is jumping 
if(P:getYSpeed(context.player)>0)then
-- and here, if the player is jumping we make the items move
M:moveY(context.matrices, P:getYSpeed(context.player))
end
when i jump with a item in my hand, the item will move up, we use the function P:getYSpeed(context.player) to have a smooth animation that will move follow the player momentum smoothly

Model part animations

i still need to explore them properly, give me time please, if you know anything about them, please send a pull request or contact me on my discord server https://discord.gg/CYTuJz8PYK

Animator:moveX(int indexStart, int indexEnd, float amount)

Animator:moveY(int indexStart, int indexEnd, float amount)

Animator:moveZ(int Start, int End, float amount)

those move a specific part of a model, Start and End represent where the piece of the model you want to move start and end, amount represent how much a model will move in a specific axis

Animator:rotateX(int indexStart, int indexEnd, float amount)

Animator:rotateY(int indexStart, int indexEnd, float amount)

Animator:rotateZ(int indexStart, int indexEnd, float amount)

those rotate a specific part of a model, Start and End represent where the piece of the model you want to rotate start and end, amount represent how much a model will rotate around a specific axis

Animator:scale(int indexStart, int indexEnd, float x, float y, float z)

this scale a specific part of a model, Start and End represent where the piece of the model you want to scale start and end, X, Y, Z represent how much the model will be scaled on specific axis

Animator:clear()

clear every animation (i think?)

Animator:applyPoses(int index, context.matrices)

back to index